<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>we</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="js/html5shiv-3-7-2.min.js"></script>
      <script src="js/respond1-4-2.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <div class="container theme-showcase" role="main">
	    <div class="panel panel-primary">
	  		<div class="panel-heading" id="wsStatus">Zk-Web</div>
	  		<div class="panel-body jumbotron">
	    	  <div class="row">
	    		<div class="col-lg-8">
	    		  <form  role="search">
	    		        <div class="input-group">
	    		            <span class="input-group-addon">Conn:</span>
      						<input type="text" class="form-control">
      						<span class="input-group-btn">
        						<button class="btn btn-default" type="button">连接</button>
      						</span>
      					</div>	
				   </form>
	    		 </div>
	    		 <!--zk tree-->
	    		 <div class="col-lg-8">
	    		     <textarea rows="10" cols="92" id='messageBox'></textarea>  
	    		     <div class="input-group">
	    		         <input type="text" id='msg' class="form-control">
	    		         <span class="input-group-btn">
	    		            <button id='send' class="btn btn-default" type="button" onclick="sendMsg()">Send</button>
	    		         </span>
	    		     </div> 
	    		 </div><!--zk tree end-->
	    	  </div><!--row-->
	  		</div><!--panel body-->
	    </div><!--panel main-->
    </div><!--container-->
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="js/jquery1-11-1-min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
    <script src="js/socket.js"></script>
    <script type='text/javascript'>
             var res =  $('#messageBox');
             Transport.init({
               "status":"wsStatus",
               "path":"/zk-web/servlet/a",
               "onmessage":function doMsg(m){
                   var data = m.data;
	                if (data) {
	                    data+='\n';
	                    res.append(data);
	                }
              }});
              function sendMsg(){
                  var msg = $('#msg');
                  Transport.send(msg.val());
                  msg.val('');
              }
        </script>
  </body>
</html>